<!DOCTYPE html>
<html lang="{{ locale }}">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    {% if noindex -%}
    <meta name="robots" content="noindex">
    {%- endif %}

    {% include "partials/meta.njk" %}
    <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ site.url }}/feeds/blog.xml">

    <link rel="preload" as="font" crossorigin href="/fonts/google-sans-v2003/regular/latin.woff2">
    <link rel="preload" as="font" crossorigin href="/fonts/google-sans-v2003/medium/latin.woff2">

    {% if process.env.NODE_ENV === 'production' %}
      {# CSS will be injected by purify-css plugin. #}
    {% else %}
      <link rel="stylesheet" href="/css/main.css">
    {% endif %}

    <script type="module" src="{{ helpers.hashForProd('/js/main.js') }}"></script>
    {% if process.env.NODE_ENV === 'production' %}
      <script async src="https://www.google-analytics.com/analytics.js"></script>
    {% endif %}

    {# Add a facility for pages to declare an array of script paths. #}
    {# Note: We could also use this approach to load module/nomodule scripts #}
    {# https://philipwalton.com/articles/deploying-es2015-code-in-production-today/ #}
    {% if pageScripts %}
      {% for item in pageScripts %}
        <script type="module" src="{{ helpers.hashForProd(item) }}"></script>
      {% endfor %}
    {% endif %}

    <script>{% include 'partials/script.js' %}</script>
  </head>
  <body>
    <div class="scaffold">
      {% block header %}
        {% include 'partials/top-nav.njk' %}
      {% endblock %}

      {% block navigation_rail %}
        {% include 'partials/navigation-rail.njk' %}
      {% endblock %}

      {% block sidebar %}
        {% include 'partials/side-nav.njk' %}
      {% endblock %}

      <main tabindex="-1" id="main-content" data-side-nav-inert data-search-inert>
        {% include 'partials/banner.njk' %}
        {% block title_bar %}{% endblock %}
        {% block content %}{% endblock %}
      </main>

      {% block footer %}
        {% include 'partials/footer.njk' %}
      {% endblock %}
    </div>
    {% include 'partials/cookie-banner.njk' %}
  </body>
</html>
